package server

import (
	"rpc/model"
	"rpc/proto/goods"
)

func GoodsCreate(in *goods.GoodsCreateReq) (*model.Goods, error) {
	stu := model.Goods{
		GoodsId:      in.GoodsId,
		GoodsName:    in.GoodsName,
		GoodsPrice:   in.GoodsPrice,
		GoodsNum:     in.GoodsNum,
		GoodsAddress: in.GoodsAddress,
	}
	err := stu.CreateGoods()
	if err != nil {
		return nil, err
	}
	return &stu, nil
}
